package com.arrays;

import java.util.*;

/**
 * @author 13699
 */
public class ReadOnly {
    static Collection<String> data=new ArrayList<>(Countries.names(6));

    public static void main(String[] args) {
        Collection<String> c= Collections.unmodifiableCollection(new ArrayList<>(data));
        System.out.println(c);
        List<String> a=Collections.unmodifiableList(new ArrayList<>(data));
        ListIterator<String> lit=a.listIterator();
        System.out.println(lit.next());
        Set<String> s=Collections.unmodifiableSet(new HashSet<>(data));
        System.out.println(s);
        Set<String> ss=Collections.unmodifiableSortedSet(new TreeSet<>());
        Map<String,String> m=Collections.unmodifiableMap(
                new HashMap<>(Countries.capitals(6)));
        System.out.println(m);

        Map<String,String> sm=Collections.unmodifiableSortedMap(
                new TreeMap<>(Countries.capitals(6)));
    }
}
